<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import="com.card.notice.*,java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Admin</title>
<meta name="description" content="Administry - Admin Template by www.865171.cn" />
<meta name="keywords" content="Admin,Template" />
<link rel="shortcut icon" type="image/png" HREF="img/favicons/favicon.png"/>
<link rel="icon" type="image/png" HREF="img/favicons/favicon.png"/>
<link rel="apple-touch-icon" HREF="img/favicons/apple.png" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<link rel="stylesheet" href="css/custom.css" type="text/css" />
<link rel="stylesheet" type="text/css"
	href="css/jquery-ui-1.8.17.custom.css" />
<link rel="stylesheet" type="text/css" href="js/jqgrid/ui.jqgrid.css" />
<script type="text/javascript" SRC="js/swfobject.js"></script>
<script type="text/javascript" SRC="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" SRC="js/jquery.ui.core.min.js"></script>
<script type="text/javascript" SRC="js/jquery.ui.widget.min.js"></script>
<script type="text/javascript" SRC="js/jquery.ui.tabs.min.js"></script>
<script type="text/javascript" SRC="js/jquery.tipTip.min.js"></script>
<script type="text/javascript" SRC="js/jquery.superfish.min.js"></script>
<script type="text/javascript" SRC="js/jquery.supersubs.min.js"></script>
<script type="text/javascript" SRC="js/jquery.validate_pack.js"></script>
<script type="text/javascript" SRC="js/jquery.nyroModal.pack.js"></script>
<script type="text/javascript" SRC="js/jquery.dataTables.min.js"></script>
<script type="text/javascript"
	src="js/timepack/jquery-ui-1.8.17.custom.min.js"></script>
<script type="text/javascript"
	src="js/timepack/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"
	src="js/timepack/jquery-ui-timepicker-zh-CN.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
	
	/* setup navigation, content boxes, etc... */
	Administry.setup();
	
	/* datatable */
	$('#table').dataTable();
	
	/* expandable rows */
	Administry.expandableRows();
});
function remove_advice(a_id)
{
	var code = confirm("确认要删除吗?");
		
	if(code == true) {
	    $.ajax({
	   		type:"post",//请求方式
	  		url:"/GameServer/remove_data",//发送请求地址
	   		data:{type:'notice',id:a_id},
	  	 	success:function(data,textStatus){
	  	 		var mailbody = document.getElementById("mainbody");
	  	 	  	var cell = document.getElementById("tr"+a_id);
	  	 	  	if(cell!=undefined){
	  	 	     	mainbody.removeChild(cell);
	  	 	  	} 
	   		}
	   	}); 
	}
}
</script>
<body>
<%
	List<GlobNotice> noticeList = NoticeManager.getInstance().getNoticeFromDB();
%>
	<!-- Header -->
	<%@include file="head.jsp" %>
	<div id="page">
		<!-- Wrapper -->
		<div class="wrapper">
			<section class="column width8 first">
					<div class="clear">&nbsp;</div>
					<table class="display stylized" id="table">
						<thead>
							<tr>
								<th>公告内容</th>
								<th>开始时间</th>
								<th>结束时间</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody id="mainbody">
						<% 
							for(int i = 0;i < noticeList.size();i++){
								GlobNotice gn = noticeList.get(i); 
						%>
						
							<tr class="gradeX" id="tr<%=gn.getNoticeId() %>">
								<td><%=gn.getDesc()%></td>
								<td><%=gn.getStartDate()%></td>
								<td><%=gn.getEndDate()%></td>
							    <td class="left">
							    	<input onclick="remove_advice('<%=gn.getNoticeId() %>');" class="btn btn-red big" value="删除" size="2"/>
							    </td>
							</tr>
						<%
							}
						%>
						<!-- <tfoot>
							<tr>
								<th>公告内容</th>
								<th>开始时间</th>
								<th>结束时间</th>
								<th>操作</th>
							</tr>
						</tfoot> -->
					</table>
					<div class="clear">&nbsp;</div>
					<div>
						<p>
							<input type="submit" onclick="location.href='/GameServer/Noticedata_add.jsp'" class="btn btn-red" value="添加新公告"/>  
						</p>
					</div>
			</section>
			
		</div>
	</div>
	<footer id="bottom">
		<div class="wrapper-login">
			<p>Copyright &copy; 2013 <b><a HREF="http://www.lxkj.com" title="www.lxkj.com">www.lxkj.com</a></b> | Icons by <a HREF="http://www.lxkj.com">lxkj</a></p>
		</div>
		
	</footer>
	<a href="#" id="totop">^ scroll to top</a>
	<script type="text/javascript" SRC="js/administry.js"></script>
</body>
</html>